package com.xmy.controller;

import com.xmy.api.IPayService;
import com.xmy.entity.Result;
import com.xmy.pojo.ShopPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangjinlinag
 * @Classname PayController
 * @Description TODO
 * @Date 2021/5/12 3:49 下午
 */
@RestController
@RequestMapping
public class PayController {
    @Autowired
    private IPayService payService;

    @PostMapping("/pay/create")
    public Result createPayment(@RequestBody ShopPay shopPay){
        return payService.createPayment(shopPay);
    }

    @PostMapping("/pay/callback")
    public Result callbackPayment(@RequestBody ShopPay shopPay){
        return payService.callbackPayment(shopPay);
    }
}
